package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/6/12.
 * 支付订单前检查订单支付状态
 */

public class CheckOrderPayStatusApi extends BaseApi {
    CheckOrderPayStatusReq req;

    public CheckOrderPayStatusApi(String order_id) {
        req = new CheckOrderPayStatusReq(order_id);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).checkOrderPayStatus(requestBody);
    }

    class CheckOrderPayStatusReq {
        private String order_id;

        public CheckOrderPayStatusReq(String order_id) {
            this.order_id = order_id;
        }
    }
}
